import {fileURLToPath, URL} from 'node:url'

import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'

// https://vite.dev/config/
export default defineConfig({
    base: "./",
    plugins: [
        vue(),
        vueDevTools(),
    ],
    build: {
        rollupOptions: {
            external: ['electron', 'path', 'node:path', 'net'],
            input: {
                main: "src/main/main.ts",
                index_renderer: "src/index/renderer/index.html",
                index_preload: "src/index/preload/main.ts"
            },
            output: {
                dir: "./buildout",
                entryFileNames: "[name].js",
            }
        }
    },
    resolve: {
        alias: {
            '@': fileURLToPath(new URL('./src', import.meta.url))
        },
    },
})
